package com.cloudm.technician.ui.modules.cloudm_box.upload_pic_token

import com.cloudm.technician.data.model.ImageInfo
import com.cloudm.technician.data.model.UploadTokenInfo
import com.cloudm.technician.ui.base.BasePresenter
import com.cloudm.technician.ui.base.BaseView
import java.io.File

/**
 * 作者: wesley
 * 时间: 2017/12/23
 * 描述: 协议接口
 */
interface UploadPicTokenContract {

    interface View : BaseView {

        fun buildImageInfoSuccess(list: ArrayList<ImageInfo>)

        fun showBottomDialogFragment(position: Int)

        fun showLoadingMsg(position: Int, url: String)

        fun openPicPreviewActivity(position: Int, url: String)

        fun showErrorMsg(errorMsg: String)

        fun updateUiByFlag(flag: Int, position: Int)

        fun showTokenInfoEmpMsg()

        fun loadTokenInfoSuccess(info: UploadTokenInfo, file: File, position: Int)

        fun picUploadFailure()

        fun showUploadPercent(position: Int, percent: Double)

        fun picUploadSuccess(url: String, position: Int)

        fun getOrderNumber(): String?

        fun showOrderNumberEmpMsg()

        fun showUnknowError()

        fun showPicEmpMsg()

        fun openTransferActivity(orderNumber: String, url: String)
    }

    interface Presenter : BasePresenter {

        fun buildImageInfo()

        fun onItemClick(info: ImageInfo, position: Int)

        fun getUploadToken(file: File, position: Int)

        fun uploadFile(info: UploadTokenInfo, file: File, position: Int)

        fun onNextClick(orderNumber: String?, list: ArrayList<ImageInfo>)
    }
}